/* //加密字符串的模块
var crypto = require('crypto');
//选择加密方式为md5
var md5 = crypto.createHash('md5');

var pwd = "12";
var pwd_cryptoed = md5.update(pwd).digest('hex'); */
/**
 * 数据加密方法
 * @param string pwd
 * return string pwd_crypto
 */
var crypto = require('crypto');

function cryptoStr(str) {
    //选择加密方式为sha1
    var sha1 = crypto.createHash('sha1');
    //加密str
    var newStr = sha1.update(str).digest('hex');

    return newStr;
}

module.exports = cryptoStr;




